#ifndef CONSOLE_H
#define CONSOLE_H

/*Copyright (c) 2009 Michael Streif
 *
 *Permission is hereby granted, free of charge, to any person obtaining a copy
 *of this software and associated documentation files (the "Software"), to deal
 *in the Software without restriction, including without limitation the rights
 *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *copies of the Software, and to permit persons to whom the Software is
 *furnished to do so, subject to the following conditions:
 *
 *The above copyright notice and this permission notice shall be included in
 *all copies or substantial portions of the Software.
 *
 *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 *THE SOFTWARE.
 */

#include "types.h"

// Console colors:
#define FG_BLACK			0x00
#define FG_BLUE				0x01
#define FG_GREEN			0x02
#define FG_CYAN				0x03
#define FG_RED				0x04
#define FG_MAGENTA			0x05
#define FG_BROWN			0x06
#define FG_LIGHTGRAY		0x07

#define BG_BLACK			0x00
#define BG_BLUE				0x10
#define BG_GREEN			0x20
#define BG_CYAN				0x30
#define BG_RED				0x40
#define BG_MAGENTA			0x50
#define BG_BROWN			0x60
#define BG_LIGHTGRAY		0x70

#define FG_DARKGRAY			0x08
#define FG_LIGHTBLUE		0x09
#define FG_LIGHTGREEN		0x0A
#define FG_LIGHTCYAN		0x0B
#define FG_LIGHTRED			0x0C
#define FG_LIGHTMAGENTA		0x0D
#define FG_YELLOW			0x0E
#define FG_WHITE			0x0F

#define BG_DARKGRAY			0x80
#define BG_LIGHTBLUE		0x90
#define BG_LIGHTGREEN		0xA0
#define BG_LIGHTCYAN		0xB0
#define BG_LIGHTRED			0xC0
#define BG_LIGHTMAGENTA		0xD0
#define BG_YELLOW			0xE0
#define BG_WHITE			0xF0

void putch(char c);
void clearscreen();
void setupConsole(uint16 pages);
void gotoxy(uint8 x, uint8 y);
void puts(char* str);

#endif
